<template>
  <el-container>
    <el-breadcrumb separator-class="el-icon-arrow-right">
      <el-breadcrumb-item>首页</el-breadcrumb-item>
      <el-breadcrumb-item>系统管理</el-breadcrumb-item>
      <el-breadcrumb-item>岗位管理</el-breadcrumb-item>
    </el-breadcrumb>
    <el-header>
      <el-form inline>
        <el-form-item label="岗位编码" size="mini">
          <el-input placeholder="岗位编码"></el-input>
        </el-form-item>
        <el-form-item label="岗位名称" size="mini">
          <el-input placeholder="岗位名称"></el-input>
        </el-form-item>
        <el-form-item label="状态" size="mini">
          <el-select placeholder="状态" value="全部">
            <el-option value="全部" />
            <el-option value="正常" />
            <el-option value="禁用" />
          </el-select>
        </el-form-item>
        <el-form-item size="mini">
          <el-button icon="el-icon-search" type="primary">查询</el-button>
          <el-button icon="el-icon-refresh">重置</el-button>
        </el-form-item>
      </el-form>
    </el-header>
    <el-main>
      <el-row style="float: right; margin-bottom: 10px;">
        <el-button icon="el-icon-plus" size="mini" type="primary">新增</el-button>
        <el-button icon="el-icon-delete" size="mini" type="danger">删除</el-button>
        <el-button icon="el-icon-download" size="mini" type="warning">导出</el-button>
      </el-row>
      <el-table :cell-style="{ textAlign: 'center' }"
                :data="tableData" :header-cell-style="{ backgroundColor: '#f7f8fa', textAlign: 'center' }"
                size="mini">
        <el-table-column type="selection" />
        <el-table-column label="岗位编号" prop="num"/>
        <el-table-column label="岗位编码" prop="code"/>
        <el-table-column label="岗位名称" prop="name"/>
        <el-table-column label="排序" prop="order"/>
        <el-table-column label="状态" prop="status">
          <template slot-scope="scope">
            <el-switch active-color="#13ce66" v-model="scope.row.status" />
          </template>
        </el-table-column>
        <el-table-column label="创建时间" prop="createDate"/>
        <el-table-column label="操作">
          <template slot-scope="scope">
            <el-button icon="el-icon-edit" title="编辑" type="text"></el-button>
            <el-button icon="el-icon-circle-plus-outline" title="新增" type="text"></el-button>
            <el-button icon="el-icon-delete" style="color: red" title="删除" type="text"></el-button>
          </template>
        </el-table-column>
      </el-table>
      <el-pagination :total="3" layout="total, sizes, prev, pager, next, jumper" />
    </el-main>
  </el-container>
</template>

<script>
export default {
  data () {
    return {
      tableData: [
        { code: 'CEO', createDate: '2022-07-27', name: '董事长', num: '1', order: 1, status: true },
        { code: 'PM', createDate: '2022-09-03', name: '项目经理', num: '2', order: 2, status: true },
        { code: 'HR', createDate: '2022-12-10', name: '人力资源', num: '3', order: 3, status: true }
      ]
    }
  }
}
</script>

<style scoped>
.el-breadcrumb {
  margin: 5px;
}
.el-container {
  background-color: #eef3fa;
  height: 100%;
  padding: 10px;
}
.el-form-item--mini.el-form-item {
  margin-bottom: 0;
}
.el-header {
  background-color: white;
  margin: 10px 0;
  padding: 15px 30px;
}
.el-main {
  background-color: white;
}
.el-pagination {
  margin-top: 10px;
  text-align: right;
}
</style>
